package com.thesharegame.dal.search;

import com.thesharegame.model.Market;
import com.thesharegame.model.Portfolio;
import com.thesharegame.model.Stock;
import com.thesharegame.model.User;

public class SQLGeneratorFactory {

	private static SQLGeneratorFactory INSTANCE;
	
	private SQLGeneratorFactory(){
		
	}
	
	public static SQLGeneratorFactory getInstance(){
		if(INSTANCE == null){
			INSTANCE = new SQLGeneratorFactory();
		}
		return INSTANCE;
	}
	
	public SQLGenerator createGenerator(Object object){
		if(object instanceof User){
			return new UserSQLGenerator();
		}else if(object instanceof Market){
			return new MarketSQLGenerator();
		}else if(object instanceof Stock){
			return new StockSQLGenerator();
		}else if(object instanceof Portfolio){
			return new PortfolioSQLGenerator();
		}
		return null;
	}
}
